%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/v4/empty-array"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 10, 11, 24, 12<br />2: PgSelect[9]<br />3: Connection[13]<br />4: ConnectionItems[15]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 13, 15<br /><br />ROOT Connectionᐸ9ᐳ[13]"):::bucket
    Bucket3("Bucket 3 (listItem)<br /><br />ROOT __Item{3}ᐸ15ᐳ[18]"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 19<br /><br />ROOT PgSelectSingle{3}ᐸpersonᐳ[19]"):::bucket
    Bucket5("Bucket 5 (listItem)<br /><br />ROOT __Item{5}ᐸ22ᐳ[23]"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket3
    Bucket3 --> Bucket4
    Bucket4 --> Bucket5

    %% plan dependencies
    PgSelect9[["PgSelect[9∈0] ➊<br />ᐸpersonᐳ<br />More deps:<br />- Constantᐸ1ᐳ[24]"]]:::plan
    Object12{{"Object[12∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Object12 --> PgSelect9
    Access10{{"Access[10∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access11{{"Access[11∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access10 & Access11 --> Object12
    Connection13[["Connection[13∈0] ➊<br />ᐸ9ᐳ<br />More deps:<br />- Constantᐸ1ᐳ[24]"]]:::plan
    PgSelect9 --> Connection13
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access10
    __Value2 --> Access11
    ConnectionItems15[["ConnectionItems[15∈0] ➊"]]:::plan
    Connection13 --> ConnectionItems15
    __Item18[/"__Item[18∈3]<br />ᐸ15ᐳ"\]:::itemplan
    ConnectionItems15 ==> __Item18
    PgSelectSingle19{{"PgSelectSingle[19∈3]<br />ᐸpersonᐳ"}}:::plan
    __Item18 --> PgSelectSingle19
    PgClassExpression20{{"PgClassExpression[20∈4]<br />ᐸ__person__.”id”ᐳ"}}:::plan
    PgSelectSingle19 --> PgClassExpression20
    PgClassExpression21{{"PgClassExpression[21∈4]<br />ᐸ__person__...full_name”ᐳ"}}:::plan
    PgClassExpression20 o--o PgClassExpression21
    PgClassExpression22{{"PgClassExpression[22∈4]<br />ᐸ__person__.”aliases”ᐳ"}}:::plan
    PgSelectSingle19 --> PgClassExpression22
    __Item23[/"__Item[23∈5]<br />ᐸ22ᐳ"\]:::itemplan
    PgClassExpression22 ==> __Item23

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect9,Access10,Access11,Object12,Connection13,ConnectionItems15 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1 bucket1
    classDef bucket3 stroke:#ffa500
    class Bucket3,__Item18,PgSelectSingle19 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,PgClassExpression20,PgClassExpression21,PgClassExpression22 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5,__Item23 bucket5

